package com.zhh.front.controller;

import com.zhh.api.pojo.BaseInfo;
import com.zhh.front.view.RespResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "平台信息功能")
@RestController
@RequestMapping("/v1")
public class PlatInfoController extends BaseController{

    //平台基本信息
    @ApiOperation(value = "平台三项基本信息",notes = "注册人数，平均利率，投资金额")
    @GetMapping("/plat/info")
    public RespResult queryPlatBaseInfo(){

        //调用远程dataservice中的对象的方法,取出平台三项基本数据
        BaseInfo baseInfo = platBaseInfoService.queryPlatBaseInfo();

        //成功，返回对象给前端
        RespResult result = RespResult.ok();
        result.setData(baseInfo);

        return result;
    }

}
